/**
 * Operation entity. Getters & setters.
 */
package com.xoomworks.rsfr.model;

import java.io.Serializable;

/**
 * The persistent class for the operations database table.
 * @author andrea.ghisa
 *
 */
public class Operation extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    private String operationName;

    /**
     *Constructor with no fields.
     */
    public Operation() {
    }

    /**
     * Constructor with specified parameters.
     * @param operationName Operation Represents the name of the operation which user have acces
     * (e.g getUser, addCompany).
     */
    public Operation(final String operationName) {
        super();
        this.operationName = operationName;
    }

    /**
     * Gets the operation name.
     * @return operationName String Represents the name of the operation.
     */
    public String getOperationName() {
        return this.operationName;
    }

    /**
     * Sets the operation name.
     * @param operationName  String Which is used to set the operationName.
     */
    public void setOperationName(final String operationName) {
        this.operationName = operationName;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = (prime * result)
                + ((operationName == null) ? 0 : operationName.hashCode());
        return result;
    }

    @Override
    public boolean equals(final Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        Operation other = (Operation) obj;
        if (operationName == null) {
            if (other.operationName != null) {
                return false;
            }
        } else if (!operationName.equals(other.operationName)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Operation [operationName=" + operationName + "]";
    }

}
